﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace OrmAuto
{
		public class QuerierMarcheModelli
		{

				public DBEntities getDAL()
				{
						return new DBEntities();
				}//fM

				public MarcheAuto[] getMarche()
				{
						using (var DAL = getDAL())
						{
								return DAL.MarcheAuto.OrderBy(m => m.Marca).ToArray();
						}
				} //fM

				public ModelliAuto[] getModelli(int pIDMarca)
				{
						using (var DAL = getDAL())
						{
								return DAL.ModelliAuto.Where(mo => mo.MarcheAuto.ID == pIDMarca).OrderBy(m => m.Modello).ToArray();
						}
				} //fM
		
		////////////
		}//fC
}
